﻿using System;
using System.Collections.Generic;
using System.Windows.Data;

namespace mmUI.Converters
{
    public class SeasonCountToSeasonList : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var nCount = (int)value;
            var lstSeasons = new List<string>();
            for (var i = 1; i <= nCount; ++i )
            {
                lstSeasons.Add(string.Format("Season {0}", i));
            }
            return lstSeasons;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return ((List<string>) value).Count;
        }

        #endregion
    }
}
